// // 隐藏loading
// function hideLoading() {
//     requestCount--
//     if (requestCount === 0) {
//         document.body.removeChild(document.getElementById('loading'))
//     }
// }

// 隐藏loading
// function hideLoading() {
//     requestCount--
//     if (requestCount === 0) {
//         document.body.removeChild(document.getElementById('loading'))
//     }
// }
class Load {
    constructor() {
        this.count = 0;
        let div = document.createElement('div')
        div.className = 'mloading';
        div.innerHTML = `<div></div><div></div>`
        document.body.appendChild(div);
        div.style.display = 'none'
        this.el = div;
    }
    show() {
        this.el.style.display = 'block';
        this.count++
    }
    hide() {
        this.count--;
        if (!this.count) {
            this.el.style.display = 'none'
        }
    }
}
export default Load